add subroutine for reducing file size for sharing, working on issue #4