and yet another set of corrections thanks to my amazing JS knowledge