Change sub to map