simplified code
add license information