incorporated Daan's corrections