made loadprint a generalised function