began refactoring layer getIntersection method and added unit tests