Protocoder code adapted to Protocoder v0.96.1