def remove_duplicates(path):
    """Takes a path and returns it with duplicate nodes removed."""
    final_path = []
    final_path.append(0)
    for i in range(1, len(path) - 1):
        if path[i] != path[i - 1]:
            final_path.append(path[i])
    if final_path[len(final_path) - 1] != 99:
        final_path.append(99)
    return final_path