Fixed a fair share of coding errors, and added a randInt() function