enhanced it to accept multiple classes