implemented boundary checks

elements that walk off the screen are removed from the array