Working on solving algorithm.