added logging and parallel running