added some code
some fixes added