cleaned code a little. added required to fields