fixed typo, better scaling and reset function