commented coded, added Apache license v2.0