added a 'main' function