Added a lot of comments and fixed a small mistake concerning the local
login