Updated to more c99-esque standards, next will be conversion to apps hungarian