added test cases, and made a singleton