Broken sorta pseudo code