Could you please point me in the direction of an article explaining how to program functions such as this?