modified according to everzets instructions