added renewal plot function and tidied NAMESPACE