adding some matrix fun
memory management?