Numbers are now placed according to the position of the previous and the following nodes. Fixes #1