added some defines fixed inverted val and addr