Added a remove item function. Cleaned up other function a bit.