add license, add tested code