Added code for global and local coordinate conversions. Still isn't working correctly.