moved around the alignment functions, added affine_align