adding optimization