diff --git a/DoubleDeckerBus/DoubleDeckerBus/CollectionGenericObjects/MassiveGenericObjects.cs b/DoubleDeckerBus/DoubleDeckerBus/CollectionGenericObjects/MassiveGenericObjects.cs index 16ceba5..614f73c 100644 --- a/DoubleDeckerBus/DoubleDeckerBus/CollectionGenericObjects/MassiveGenericObjects.cs +++ b/DoubleDeckerBus/DoubleDeckerBus/CollectionGenericObjects/MassiveGenericObjects.cs @@ -75,12 +75,12 @@ public class MassiveGenericObjects : ICollectionGenericObjects } while (copy_of_position > 0) { - if (_collection[position] == null) + if (_collection[copy_of_position] == null) { - _collection[position] = obj; - return position; + _collection[copy_of_position] = obj; + return copy_of_position; } - position--; + copy_of_position--; } return -1;