updates+fixes+improvements

updates from varun source
fixes from dragonpt source
improvements from dragonpt source