Changes:

Added flowerList() and flowerLocation() methods. Tried to find the error that causes the butterfly to alternate between 2 tiles - always occurs on the edge of the map, so has something to do with that. Tried writing lines 75-78, but it still doesn't work. I need to understand your code better...

My (working) implementation is below everything else, commented out.