add prototype (almost the same as q3 code)