Added input operator and constructor