Date select now works for the moment, optimization definitely needed