added layer as parameter to get_pointing_chains()