initail commit

changed some logic