refactored; first test "works" now