Implemented download functionality.