Add more documentation and notes on the procedures and logic