added getDeterminant and fixed bug