added rand point function