Updated to include parameterized queries