fixing the trim(); and adding random();