Initial version of the code

Not meant to be used like this but functional