some skeleton code from A1