solving the dick problem