removed Reset()
cleaned code a bit