Updated Entire Structure

Updated the code structure, merged unnecessary functions into the new
and improved comments for clarity and easier readability