miscellaneous pi scripts