Database optimization is on going(still has bugs)