misc useful functions and code snippets using irpf90