UPDATE: added recursive flag