changed some stuff to main program. Its been a while