added logging functionality. improved job scheduling. some code cleanup