working on optimization controller