some bugs fixed. need to implement range sampling and moving window classes.