function and few basic login