Still having duplicates problem. Try to use HashMap next time