added shortTimeEnergy function