Added Comments, fixed bugs