added fromCharCodes, homegrown parseInt, substring