Added the changes by @JadenWong again to resolve merge conflicts; closes #35

I re-did the changes by @JadenWong now correctly without so many commits and re-commits. Please close #35