Added more unit tests and reformatted whitespace