Implementation of fcontext