handles complex case