formatted and added comments