wrote results into textfile
started A Algorithm