Implement createUser function