cleaned a code a bit