finished & debugged