updated to accept selective dynamics