Added tests and changed how objects are created