did some debugging. preparing to split up functions into kernels.