fix the (seemingly) very broken implementation