Goalplus() problems solved, now the interval array key is dynamic and accepts the function parameter.