added commenting and test code to the joint chain class