Solution for Thumbtack challenge