adClass function complete