updated joints and corrected some calculation issues