added toInt() method