working on #19, it seems to be working but not as smooth as it should