change return type to int