Cleaned up some code and added a simple Timer class