code looking ugly right now, but overall it;s a proof of concept etc