Password checking logic implemented