added class changing functionality