updating test to cover the whole functionality