I'll turn that into a class some day for easier use, when I get to the GUI part in my engine.