added rectangle collision.