First tests and debug, seems to work, cache not tested