completed bar task with added tests; all tests pass