Updated code to fully work with low-power mode
Declared defines as long integers