commented out and changed some codes so that the basic random algo can run