continuing development
updated formula logic with tests