Changed contact transition to look for two contact points; removed some global variables.