optimization done- not tested