more stabilized code
small changes