Made better use of D features. Fixed a silly mistake.