This is strange logic for a strange case. It might want a comment. What if `classes` contains 0? Why use `insert` rather than `hstack` or `concatenate`?