recode of sweep, horizontal and vertical