Solution #31 and #36