finished drafting data checking code. need to debug and test