updated plugin version (1.2): rewrote it from scratch