completely rewritten worker