one huge function, right in the middle