fix contructor; simplify code; by dnaber