write up and fix first query