Updated to Class File

Added a new class to call it from outside and output changed to class
from console.