adding input sanity checks etc