includes optimization algo