almost there, need to add tests