Finished documenting and testing the core functions (Main)