added main for correct behaviour with arguments