added query optimizer ..