small edits to the alm fxn