Working, but slow - optimization inc