Naive working implementation