reworked interface, cleaned up code