added output testing codes
merge changes