updated pretify function