Add comments and tests