code clean; exists,zexists,hexists bug fix