uncommented code from functions.,php