Testing layers code, seems to be working ok for a hack