completely implemented, but some things are still ugly