Internal (Z-Matrix) to Cartesian coordinates conversion Is there any way to convert from Internal to Cartesian coordinates using simple formulas?

I have studied and implemented: INTERNAL TO CARTESIAN by Jack D. Kunitz.

But somehow the x, y and z values are not correct. I am not implementing the transformation back to the initial frame as it says, because I do not understand that step. Is that the reason for not being able to get correct answers or is this not a good tutorial or solution to follow.
Sure, it's just trigonometry. There are a variety of open source implementations.

For example: 


InternalToCartesian from Open Babel
ChemKit
QCL Python


There are dozens in a search on GitHub if you don't like C++ or Python.

There's also a web app from Shodor for z-matrix conversion.