Reduced size even more, getting rid of useless casts. Also changed voltage to integer format.