code cleanup & added method for saving route in txt file