Use within_context for $F and $M to prevent "uninitialised variables" warnings.