fun logic problem