cleaned stuff up

renamed things to be more obvious, added some more comments