added function for rescaling, all options are working, added autorescale option (-1)