Just fixed the code a bit (general code organization).