Organinsing ssh output to correct order