Initial functionality complete with tests