add preprocess subroutine