started creating code for energy and fixed some errors in base