functionality complete with tests