add ke, am and minor bugs fixed