creating print function and correcting random fun