Added in cleaner code and comments