Finished developing function random