Added more tests and reformatted code to be constructor-based