code and samples