functioning for 0,1,2 printing out results