move around some lines and correct AES