added several features for handling complex obs