lots of nice fixes and additions
fixed conflicts