changed to OO style implementation