Bug fixes on random class

bug fix: modifies class to properly choose a random direction.