some code pieces worth remembering