Reworked the whole implementation
Merge