merged surya code to draw the result gate