solving first exercise