Fixed errors, Added c comments