Update to use custom lua formula