Fixed bugs with way the alignment was being done
fixed bugs with alignment