implemented food and collision functionality