general modular arithmetic funcs moved into seperate src files