Replaced anonymous function with create_function for PHP 5.2 support and cleaned up variable names.