Update class.php

Added download function