added matrix implementation for orientation
split types off into their own library