Split up problem and algorithm code.