Add functions; fix formula