Added getMethod function.