cleanup

code cleaned and commented