added energy and number functions but untested