fixing some bugs, adding beginning of second version after validation