merging ravi's ui code