Remade everything functionally
First attempt to add waiting for answer