added some comments, cleaned up some code that wasnt used anymore