finished another logic one, slightly harder