Lots of changes. Start work on sorting Q statements