updated README
updated flatten_param and replace some regex with replace