Fix rotmax, make var