solve exercise #23
solve exercise #24