Function class now has constructor and destructor