new layer render implemented, atm it looks overengeneerd, but in time it may get better.

WORKING BUILD(not fully tested)