Variable num change

Robert, I think that int num should start with 0 and not 1.