Initial commit
Already contains some improvements over the original versions from Erica