optimization tuning + alignment bug fix