Implemented Matrix class; still some bugfixing to do