fix wrong calculation of active tasks
some code cleanups
add more details in the README