basic idea sketched out. time to test and work out some details