removed unnecessary code, commented everything else, moved around some logic code to make things make more sense