Added comments and some other small changes