code is almost complete