print functions and fixed small errors