optimization done for 2 iterations...everything seems to work :)