fix generalized code to actually work :D