rough around the edges but working initial version