Minor bug with a quick fix:
The for statement
for(int i = 0; i < m.Length; i++)
needs to be replaced with
for(int i = 0; i < _length; i++)
To gurantee correct ouput.