implemented main-/idle- thread