working commit
technically correct is the best kind of correct
many changes, now works