generalized numpy stuff a tiny bit