Removed unnecessary imports, added randomize function, added generations counter