Added authentication from scratch