added sample code, portal schema plot support & some cleanup