packaged compile statements,step and checks into a function