lots of fixes/additions