minor optimizations and corrections to point free form