The stacking section of the code was not working properly: removed.