latest changes, just going to do this all in Javascript