Lots of optimization