Managing electricity to reduce costs