I have been trying to solve remove_duplicates without the hint and cant seem to find the logic error. Can anyone else point it out for me?

(I am used to using Java, so I know this is a lot more complicated than necessary, but I still want to understand my mistake)

Thanks!

```
def remove_duplicates(lst1):
lst2=lst1 # list to work on and return
for i in lst2:
x=1
while (x<len(lst1)) and (lst1[x]!=i): #iterates until finds duplicate
x+=1
if lst1[x]==i: #if finds duplicates, and not just end of list
for p in lst2: #removes dups from whole list
lst2.remove(i)
return lst2
```