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