Added matrix allocation functions!