several changes to make it work for area selections