part C implemented and tested. still needs some polishing (A LOT\!)