added validation from user interface
validation fixes
refactoring el1,el2 into js functions