I understand where 2d is coming from, but still, this type of stuff is stupid simple. (More of logic/trial-error trying to get the code splits right)
That code above is straight out of STS. (Minus the comments, since I figured some people are too retarded to understand what each property is for)