handle empty world

and add tests for it