preliminary break up of pokelike.c