Functions code and commments added for each function