Basic functions created.

Next step is to add the solver function. uffff... I wish I could reduce number of lines of code. That's for later.