Changed to use statements for input queries