Implemented passwordCheck() function.