finished adding comments and changed output format to the wanted format.