This may be what your looking for I'm not a programmer but it seems to be on point.