sorted out typos and added more comments