this is a ton of work stuff