Added an optimination feature