merging with junsun's work
merge with junsun