Added documentation, fixed code to follow documentation, fixed tests to better test documented behavior