Added comments, removed unused code.:w