code and dir cleanup
fixed a bug related to the alignment direction
fixed a bug related to the annotation of spaces
bug fixed
code cleanup