splited main() in more meaningful functions, removed randomFloat