working version with user data