checking array bounds for beta, alpha, u