combinereps.hs fully implemented. needs to be debugged