Added randomTransition function, don't like the result