Made the prevention of the only one code more efficient. Added special case when we only have one type of symbol