Code actually works for authentications, instructions added.