now has the code to determine mode based on what objects are in contact with eachother