Updated with second problem interpretation solution