code cleaned and checked