change alignment method into functions