added tests for all cases