changed design slightly and planned steps in optimizer