removed epsilon check from optimize