added first generic implementation and the test for QPs