this codes have been edited on November 28 2014