Added test cases. Changed contract. Added contract to class
Did some cleaning up