functions implementes, need to test