Added notes output and some new functions to support file upload