modified according to zenify/cs