Added container and changed some logic