Fixes #49, accounts for the spans of the children aswell