minor modifications made