changed some minor things and added comments