All individual functions are working.  I may have rushed a bit.  What I now need are (1) a way to initalize an array of arbitrary type with pre-determined size (this is just a syntax problem), and (2) a nicer way to define vectorization of my functions.