adding lib code and stub example