close #101
did my best, i hope it is good
later maybe i will refactor a bit more (i still have some ideas to get
better code)