BROKEN Add validation and fix bugs found