implements character constructor and tests