implemented randomly generate places algorithm