added debugging and steps for determinant