Modification of the code so that capcity is never greater than MAX_SIZE