index can pull information from database and print correctly