fixes to alm fxn