working version with defaults