fixed output prints, added comments to beginning