all works!
it needs to be refactored, but it works