Updated comments and explicitly typed the queries