Coding bat and Frame problem