If the code (you copy-pasted) works but you don't understand why then it doesn't work.
Or at least you have no idea whether it actually solves any problem besides the exact scenario you tested it for, and no idea if it's even possible to maintain it.