Commented everything thoroughly