updated apf + tweaks from Chris