Reorganized, added simple test cases