segf in writing sequence, todo