Function queue is now a circular array to avoid malloc. Fixed up some formatting and conventions on functions to avoid compiler warnings