Massive code reformat

Getting ready to implement timer