Structure changes. Multiple subjects detection added.