fixipooed stuff and added a bunch of comments