some code I produced while thinking about problems on MSE