changed matrix class, add transpose method