removed unused import; simplified duplicate check statement