solving pic prob