def maketwodimensions(x):
    """ helper function to make sure a numpy array is at least 2 dimensions """
    if len(x.shape) == 1:
        return x.reshape((x.shape[0], 1))
    else:
        return x