moved main to seperate file