commented on variables
added fundtion codes