starting a new implementation of most of it

i have no other ideas about how to fix this crash problem
lots of work on the input and control processing in the new implementation
some geometry stuff