end of tick behaviour ala node

I dropped the message authentication stuff because it doesn't
really matter
refer to node docs