finished - functioning with tests