better nested sed