add signature for fields array and hash
implement array input and output methods