helpers + random direction implementation