added
date update and removal
added sort flag for id array function