restructured code, added configurable parameters