move validation to functions, intermediate. works for owner, needs clean up