added naive duplicate checking