added inline comments

cleaned up and added some helpful comments