Update class.php

Added shorten function