implemented matrix perspective and added pi