my implementation of different algorithms from various sources.