pos structuring code. Include 2 news class,using derived functions