finished arrange class function