Added Main code from 1B