bug fixes, putting variables out of vars object