Changed functions: things will now take 4 inputs