got rid of ugly if rb, replaced with js