Cleaned up some of the basic code