added option to pass prototype

An easy way to handle defaults.