changed to return int