Band termination in the shell model