code reviewed by -Wall