Major update...

failsafes added, more code fixes/changes