Вдохновился этим постом: https://tes.reactor.cc/post/5330722