Fixed bug in formula