PR #6 is a good idea but i broke it :/ So here it is again.
fixed merge conflicts