changed the write_to_file programm so it can write only the wanted steps instead fo ALL of them