modified this guys code cuz it didnt work