Added comments and increased test coverage