Combined algorithm methods prepareInput and run