add defaults, more flexibility, add parsing function