login function implemented.