Added comments and updated tests