Fixes overflow bug - take 2