test preparation code