stripped out unused
added main pointer