adding code to data classes