Comment out test code to rewrite code into constructor function