More documenting

I also combined the foster's algorithm documentation into the main doc.