functions moved back to prototype from constructor