Added functions for Quaternion algebra