Made beginContact a bit more generic