Cleaned up MainActivity

Cleaned up mainactivity, made floats instead of ints, more comments,
less duplicate code.