fixed javascript, deleted charAt and switched to substr
seed file now works