the original problem + 2 different approaches