added common library file, prompt() function and other changes