removing quotes which where disrupting my sql statements. Removed unnecessary function