fixed inventory problems and added some back logic