added align mode to output
updated extensively