added some simple algorithms