Shortened some verbose code. Changed postfix increments to prefix. Added InBounds()