removing duplicates
fixing bug