Added function to run algorithm on puzzel.