several ways to solve these problems