Changed next and print to more modern forms compatible with both 2 & 3.