More JS fun to get it working dynamic