Get alignment routines working and tested