working version!
added a whole bunch of stuff