everything working except printing at the end