Implementation of the new gray stack enqueue