added tests for ex 1-4