Update init.lua

added login function also added afew minor changes