cleaned up algo, added double letters