Replaced Flanagan classes with Apache Commons Math