Added an if statement to alignUngapped so that if the end of the sequence is reached the last few bases are also added to the final length of the alignment