Implemented pop to root