changed queries to format string syntax