minor bug (toInt)
some minor changes