trimmed note extraction function down a bit before completing new functionality.
Can now extract both in forward and reverse direction.
Refactored variable names so that inner workings of function reflect possibility of multiple directions.
Trimmed the function a bit.
Refactored function name to better reflect versatile nature.