Added user defined vars and did clean up