cleaned/removed code and added a few comments