first compilable but buggy version with StatePFList