Added work until finished functiontity on dowork functions