Added method definitions and a Main