added directory environments as optional. added authorised key for user.