improved writeBombs function

removed unnecessary "length declaration" (loop)