Added approximate algorithm (needs to be implemented clean).