Added main function and constructor