moving to own implementation of selwriter