implemented div and mod