completed the skeleton code