fixed alignment orderings and debugged some logic errors