restructured entire program to impliment interface