Fixed main and added input/output