almost complete code