PEP formatting; switch to more numpy funcs.