implemented context switching with one thread: switches out, prints and comes back