switched to prototype method