added comments
created new functions