used the right function