Adding full phase3 functionality
Fixing merge conflict