closer to functioning with tests