tidied up ui and added validation