building fix
refactored
test program, refactored code