Got the thing working
Polished