Barebones logic implemented
Some cleanup