Added functionality for subjects with different conditions and multiprocessing support