code for class demo