reworked from copro_land by SVYATOGUB (c) 2013