Merged existing code from some of my former projects.