Updated for multi-line support