made some changes in the main file, plus did some documentation