Add check energy function
Call checkEnergy function
Add tasks
Remove unused import