Updated some data types and logic