ZCleaned up

I cleaned up some code in search and upload