cleanup and bugfix of sigma order