I think the native mod "%" is better than this method.