Implement makecontext