Changes to shape and space to support removal of shapes and fix to bb query func