Fixed isOpen and isClosed function --> no more duplicates in open and closed list