Cleaned up code and added hang up functionality