changed to int everywhere