final version, added authetication