turned prints into logs, added database query form