cleaning up code and fixing fslide computation