code cleaning, needs to be tested now...