add license header; tiny code cleanup