Added constraint on fields
Added stdin for abstracting away reading stdin