Implemented formula.c