works and prints the result