added code for slope checks, doesn't work