added some comments, cleaned some stuff up