Finally finished getting the function to work and print out to console.