Mainly starting the ad hoc query method, with some associated amendments