now with more clean code(thx netbeans)