     x: x, y: y
 
 next_iteration = (bugs) ->
-  bugs
+  bug_list = []
+
+  for column in bugs.grid
+    for bug in column
+      if bug?
+        bug_list.push bug
+
+  shuffle_array bug_list
+
+  for bug in bug_list
+    move_bug bugs, bug
+
+  console.log 'end iteration'
+
+move_bug = (bugs, bug) ->
+  bug.location.x += 1
+  bug.location.y += 1
 
 render_game = (canvas, bugs) ->
   canvas.clear()

  bugs  = starting_bugs()
  render_game canvas, bugs

  #next_turn bugs, canvas, turns

next_turn = (bugs, canvas, turns) ->
  bugs = next_iteration bugs
  render_game canvas, bugs

  if turns < 1000
    setTimeout((-> next_turn bugs, canvas, turns + 1), 10)

starting_bugs = ->
  grid = []

  for x in [0..59]

create_fly_trap =
  (info) ->
    if info.front == 'OTHER' then 'EAT' else 'TURN_LEFT'

create_moth =
  (info) ->
    if info.front == 'OTHER'
      'EAT'
    else if info.front == 'EMPTY'
      'WALK_FORWARD'
    else
      'TURN_LEFT'

shuffle_array = (array) ->
  i = array.length
  return [] if i is 0

  while --i
      j = Math.floor(Math.random() * (i+1))
      [array[i], array[j]] = [array[j], array[i]]
