Fixed a uint overflow problem! Still not working correctly.