Completely changed implementation