cleaned and added comments