Added constraints and changed some data types