some stuff private, especially det(int,int,int)