fixed object orientation

detection of several objects at the same time
remember that ++it_ref is faster than it_ref++