Correctly implemented the inc function.