calculating area under curve