optional classes param to list classes

untested code, sorry