added historical inventory functionalities