first commit of the code, haven't yet made sure it works on its own