fixes to phlawd formula