Added some type casting as well as included time so the srand will work