Added Main functionality