set_span, set_freq methods are added but they are not tested yet
many features are added at this stage
This file is taken from gist git