graphics stuff fixed. Added logic to detect randomness