Seperated the paramaters out of the code. Chainged main accordingly.
Changes too.