some new useful fxns
debugged, improved, renamed