issue #8 is done.

i have to take a mod before division! Otherwise i can get wrong results
issue #9 is done.