logic implemented, cleaning up

fixes #001