Enhanced optimizer class (now optimize only needed table), fixed minor bug
Updated revision