Added license header and minor modifications