more on HD upgrade

major revision of wave calculation