implemented "gradient" mode, now fully featured