changed KSequence to use persistent data structure again
reimplemented KList