added bomb limit + small refactoring