added in collison detection