Adding randomString function
Code cleanup