fixed parameters; started implementation of clipping