length - the th at end are switched