issue #18 restructured methods and changes in variable names