removed some useless code and added simple license checking code