- Took X to class variables
- Changed convert so there will be no memory leak