Convert to integer math, reorganize for release