added doc and cleaned up