Fixed energy net (I Hope) and refactored code
More stuffs