I spent 4 hours on this