Added keys to input table function, tested out query in main