adding function to return int