pre-loop setup