These are some codes I used for assignments and work in the past years. I have annotated them well and made them readable for even newbies.