Implements multiple objects detection

WIP, untested