code for training class practice