Addressed suggested fixes and added basis for auth function