implemented both classes