adapted to netbeans