Completly reworked all code. Main and one other function are still empty.