WORKING: authentication fully implemented