public static function map(array $array, $method)
    {
        //used to make sure the method is valid
        if (gettype($method)==='object') {
            foreach ($array as $key=>$value) {
                //assign return values to value of the array
                $array[$key] = call_user_func_array($method, [$key,$value]);
            }
            //return the modified array
            return $array;
        } else {
            //send error messages if the method is not valid
            system::add_error('ary::map()', 'missing_function', 'second parameter must be a function object');
        }
    }