removing a warning and fixing layout.
layout only.
moving stop to outside.
flatten spawn and onErr.
flatten getCurrent.
adding comments.
using atomicModifyIORef' not to leak space.