Datacentres consume incredible amounts of energy for data processing, storage and communication, which negatively impacts the environment through carbon emissions. This paper proposes a novel scheduling algorithm aimed at reducing energy consumption in cloud computing datacentres, with the objective to save the environment. It optimises Virtual Machines' (VMs') allocation and consolidation so as to improve resource utilisation of running servers and the shutdown of idle servers. The proposed algorithm was evaluated and compared with two benchmarks DVFS (Dynamic Voltage Frequency Scaling) and ESWCT (Energy-aware Scheduling algorithm using Workload-aware Consolidation Technique). The results showed a significant improvement in reducing the energy and improvement in resource utilisation.