added boundary box functionality