code cleaned a little