gate but without prints and imshow