added validator
code styling
added testing