Got rid of using un-nice "global" and anonymous "create_function".