added useful rand functions