fixed bug with check tiles more than once, refactored into methods