Updated solution now that the removeitem bug was fixed.