Thank you guys for pointing out my mistakes, I appreciate it very much!
I've updated my original post with the full code.
@Vrul - sorry for the "id" variable, it got mixed up when I decided to rename the argument to "unit" for better readability and missed some occurrences.
|