reformmated and added comments