Layers update

More helper functions, a bunch still not made yet. To be done soon.