reverting some changes
adding functionalities
test function