fixed bugs in Quaternion and added more logic to it