Revised the initializeInvenotry method