add: calculate intensity, fix bugs