Added proper handling of dates
Finalized BSBM query 1