code pieces and examples