added more comments and code. Things are pretty messy right now