js now working, just slice needs to be fixed