removing deprecated functions; code not working