stupid spaghetti code.