Added empty arrays to renderState calls because trying to index an undefined variable doesnt work so well. Even with the silliness of javascript