New bug fixed codes - Dec 24 2013