validation logic .. tried regex but got too complicated made my own