A workaround for using negative numbers with JS's modulo operator