tidied rubyish PI example