Adding Matrix support
Cleanup and fixing drawing functions