Improved intersection, added main method