Updating to Trevor's new ref10_extract
1.4 with documentation and bound checks