Modifications to the bin query