serious update. Running much smoother after switching add_pages to memcpy rather than iterative for loop. Also deleted a bunch of unused code. Will implement memcpy into the write tiff potentially!