Added confirm function to eliminate code repitition. Testing still