new way of calculating ids for selections
fixed merge