Added sharing functionality, did some slight clean up.