Made it work more smoothly