removed duplcate function