refactoring: adding derive_durations helper function
refatoring and documentation
updating README