Works, more comments needed, Included a det() test