Improved unstage method. Used array splice instead of while loop.