program done, remember to check how you write the fucking data out...