got rid of unneeded jquery check for empty obj
mutual recursion allows good pathmark saving