cleaning code, adding comments, finishing framework