check alignments and removing unwanted code