Working version
Some changes